package View;
import java.awt.*;
import java.awt.event.ActionListener;

import javax.swing.*;
import javax.swing.border.*;
/*
 * Created by JFormDesigner on Sat Dec 17 14:19:02 ICT 2011
 */



/**
 * @author Khainx
 */
public class ManagerView extends JPanel {
	public ManagerView() {
		initComponents();
	}

	private void initComponents() {
		// JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
		panel1 = new JPanel();
		label1 = new JLabel();
		label2 = new JLabel();
		panel2 = new JPanel();
		btnExit = new JButton();
		panel3 = new JPanel();
		btnNew = new JButton();
		desktopPane1 = new JDesktopPane();
		btnSearch = new JButton();
		btnRequest = new JButton();
		btnSystem = new JButton();

		//======== this ========
		setPreferredSize(new Dimension(600, 400));
		setBorder(null);
		setLayout(new BorderLayout());

		//======== panel1 ========
		{
			panel1.setBorder(new EtchedBorder());
			panel1.setLayout(new GridBagLayout());
			((GridBagLayout)panel1.getLayout()).columnWidths = new int[] {0, 0};
			((GridBagLayout)panel1.getLayout()).rowHeights = new int[] {0, 0, 0};
			((GridBagLayout)panel1.getLayout()).columnWeights = new double[] {1.0, 1.0E-4};
			((GridBagLayout)panel1.getLayout()).rowWeights = new double[] {0.0, 0.0, 1.0E-4};

			//---- label1 ----
			label1.setText("Employee Transfer Management System  ");
			label1.setFont(new Font("Tahoma", Font.BOLD, 18));
			label1.setHorizontalAlignment(SwingConstants.CENTER);
			panel1.add(label1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 5, 0), 0, 0));

			//---- label2 ----
			label2.setText("Manager Account");
			label2.setFont(new Font("Tahoma", Font.BOLD, 18));
			label2.setHorizontalAlignment(SwingConstants.CENTER);
			panel1.add(label2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 0, 0), 0, 0));
		}
		add(panel1, BorderLayout.NORTH);

		//======== panel2 ========
		{
			panel2.setLayout(new FlowLayout(FlowLayout.RIGHT));

			//---- btnExit ----
			btnExit.setText("Exit");
			panel2.add(btnExit);
		}
		add(panel2, BorderLayout.SOUTH);

		//======== panel3 ========
		{
			panel3.setBorder(new EtchedBorder());
			panel3.setLayout(new GridBagLayout());
			((GridBagLayout)panel3.getLayout()).columnWidths = new int[] {0, 0, 0, 0};
			((GridBagLayout)panel3.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0};
			((GridBagLayout)panel3.getLayout()).columnWeights = new double[] {0.0, 0.0, 1.0, 1.0E-4};
			((GridBagLayout)panel3.getLayout()).rowWeights = new double[] {1.0, 1.0, 1.0, 1.0, 1.0E-4};

			//---- btnNew ----
			btnNew.setText("New");
			btnNew.setPreferredSize(new Dimension(83, 23));
			btnNew.setActionCommand("New Transfer");
			panel3.add(btnNew, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 5, 5), 0, 0));

			//======== desktopPane1 ========
			{
				desktopPane1.setBackground(Color.white);
				desktopPane1.setBorder(new EtchedBorder());
			}
			panel3.add(desktopPane1, new GridBagConstraints(1, 0, 2, 4, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 0, 0), 0, 0));

			//---- btnSearch ----
			btnSearch.setText("Search");
			btnSearch.setPreferredSize(new Dimension(83, 23));
			panel3.add(btnSearch, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 5, 5), 0, 0));

			//---- btnRequest ----
			btnRequest.setText("Request");
			btnRequest.setPreferredSize(new Dimension(83, 23));
			panel3.add(btnRequest, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 5, 5), 0, 0));

			//---- btnSystem ----
			btnSystem.setText("System");
			btnSystem.setPreferredSize(new Dimension(83, 23));
			panel3.add(btnSystem, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
				new Insets(0, 0, 0, 5), 0, 0));
		}
		add(panel3, BorderLayout.CENTER);
		// JFormDesigner - End of component initialization  //GEN-END:initComponents
	}

	// JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
	private JPanel panel1;
	private JLabel label1;
	private JLabel label2;
	private JPanel panel2;
	private JButton btnExit;
	private JPanel panel3;
	private JButton btnNew;
	private JDesktopPane desktopPane1;
	private JButton btnSearch;
	private JButton btnRequest;
	private JButton btnSystem;
	// JFormDesigner - End of variables declaration  //GEN-END:variables
	public void addFrame(JInternalFrame iframe){
		this.desktopPane1.add(iframe);
	}
	public void doNew(ActionListener listener){
		this.btnNew.addActionListener(listener);
	}
	public void doSearch(ActionListener listener){
		this.btnSearch.addActionListener(listener);
	}
	public void doRequest(ActionListener listener){
		this.btnRequest.addActionListener(listener);
	}
	public void doSystem(ActionListener listener){
		this.btnSystem.addActionListener(listener);
	}
	public void doExit(ActionListener listener){
		this.btnExit.addActionListener(listener);
	}
}
